package com.xj.reggie.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xj.reggie.common.BaseContext;
import com.xj.reggie.entity.ShoppingCart;
import com.xj.reggie.mapper.ShoppingCartMapper;
import com.xj.reggie.service.ShoppingCartService;
import org.springframework.stereotype.Service;

/**
 * @Author XJ
 * @Date 2022/10/25 15:44
 * @PackageName:com.xj.reggie.service.impl
 * @ClassName: ShoppingCartServiceImpl
 * @Description: TODO
 * @Version 1.0
 */
@Service
public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, ShoppingCart> implements ShoppingCartService {

	@Override
	public void clean() {
		LambdaQueryWrapper<ShoppingCart> queryWrapper =new LambdaQueryWrapper<>();
		queryWrapper.eq(ShoppingCart::getUserId, BaseContext.getCurrentId());
		remove(queryWrapper);
	}
}
